﻿<%@ Page Language="C#" MasterPageFile="~/TrangChu.Master" AutoEventWireup="true" CodeBehind="Lambai.aspx.cs" Inherits="DOAN.Lambai" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <meta http-equiv="refresh" content="<%=seconds%>;url=thongbao.aspx">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:DropDownList ID="drpMon" runat="server"></asp:DropDownList><br />
    <asp:TextBox ID="txtmade" runat="server"></asp:TextBox>
    <asp:Button ID="btn" runat="server" Text="Bat Dau" onclick="btn_Click" />
    <table style="width: 100%;">
        <tr>
            <td>
                Bài thi môn : <b><%=getmon() %></b>
            </td>
            <td>
                Mã đề thi : <b><%=getid() %></b>
            </td>
            <td>
                <div id="timelabel">
                </div>
            </td>
        </tr>
    </table>

    <script type="text/javascript">
        var leave =<%=seconds %>;
        
        
        CounterTimer();
        var interv=setInterval(CounterTimer,1000);
        function CounterTimer()
        {
        
        if(leave==0)
        {
       
          alert("thoi gian da het");
        }
        
        else{
        var day = Math.floor(leave / ( 60 * 60 * 24))
        var hour = Math.floor(leave / 3600)-(day * 24)
        var minute = Math.floor(leave / 60)- (day * 24 *60)-(hour * 60)
        var second = Math.floor(leave)-(day * 24 *60*60)- (hour * 60 * 60)-(minute*60)
        hour=hour<10 ? "0" + hour : hour;
        minute=minute<10 ? "0"+ minute : minute;
        second=second<10 ? "0" + second : second;
        var remain=hour + ":"+minute+":"+second;
        leave=leave-1;
        document.getElementById("timelabel").innerHTML="<b>Thời gian:</b>" +remain;
        }
        
        }
   
//Test 


    </script>
    <center>
        <asp:Literal id="Literal1" runat="server"></asp:Literal>
        <br />
    
        <iframe src="Thi.aspx?MaDT=<%=getid() %>&Cau=1" id="thi" width="600" height="400"></iframe>
    </center>
</asp:Content>

